template "Boot Sector FAT"

// Template by Stefan Fleischmann
//   : Shura
// Boot sector format for MSDOS 4.0 onwards (incl. Windows 9x)
// To be applied to sector 0 of a FAT12/FAT16-formatted logical drive.

description "BIOS parameter block (BPB) and more"
applies_to disk
sector-aligned

requires 0x0	"EB"	// JMP instruction will usually be EB xx 90
requires 0x2	"90"	// (though older drives may use E9 xx xx)
requires 0x1FE "55 AA"

begin
	read-only hex 3 "JMP "
	char[8]	"OEM"

	section	"  BIOS"
	uint16	"  "
	uint8		"  "
	uint16	" "
	uint8		" FAT"
	uint16	"   ."
	uint16	" ( 32 M)"
	hex 1		"  (hex)"
	uint16	"  FAT"
	uint16	"  "
	uint16	""
	uint32	" "
	uint32	" ( 32 M)"
	endsection

	hex 1		"BIOS  (hex, HD=8x)"
	read-only uint8 "( )"
	hex 1		".   (29h)"
	uint32	"   (.)"
	move -4
	hex 4		"   (hex)"
	char[11] " "
	char[8]	" "

	goto		0x1FE
	read-only hex 2 " (55 AA)"
end